import fetch from 'common/src/utils/fetch'

const api = {
  // 查询导师列表
  getTutorList(data) {
    return fetch({
      url: '/api/designservice/applicationStudent/getApplicationTask',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查教务员列表
  getAcademicList(data) {
    return fetch({
      url: '/api/designservice/optApproval/list',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查指定人列表
  getDesignatedList(data) {
    return fetch({
      url: '/api/designservice/optApproval/approvalList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 导师 查学生成绩详情列表
  getReviewList(data) {
    return fetch({
      url: '/api/designservice/resultPublish/detail',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 导师 审核通过(驳回)
  approval(data) {
    return fetch({
      url: '/api/designservice/applicationStudent/approval',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 教务员 指定审核人
  designated(data) {
    return fetch({
      url: '/api/designservice/optApproval/changeApproval',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 教务员 查指定审核人资源列表
  getDesigntedDetail(data) {
    return fetch({
      url: '/api/designservice/optApproval/userList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 教务员 查导师学生课题详情
  getSubjectInfo(data) {
    return fetch({
      url: '/api/designservice/optApproval/detail',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查导师学生课题详情
  getDetail(data) {
    return fetch({
      url: '/api/designservice/optInfo/detail',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 师生互选查课题详情
  getSubjectDetail(data) {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/detail',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 指定人 批量审核
  designatedApproval(data) {
    return fetch({
      url: '/api/designservice/optApproval/approval',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 工作流 批量通过
  workflowBatchPass(data) {
    return fetch({
      url: '/api/workflow/approval/through/batch',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data: data
    })
  },
  // 工作流 批量驳回
  workflowBatchReject(data) {
    return fetch({
      url: '/api/workflow/approval/reject/batch',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data: data
    })
  },
  // 工作流 单个通过
  workflowPass(data) {
    return fetch({
      url: '/api/workflow/approval/through',
      method: 'post',
      data
    });
  },
  // 工作流 单个驳回
  workflowReject(data) {
    return fetch({
      url: '/api/workflow/approval/reject',
      method: 'post',
      data
    });
  },
  // 导师 导出
  tutorExport(data) {
    return fetch({
      url: '/api/designservice/applicationStudent/export',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 学院教务员 导出
  academicExport(data) {
    return fetch({
      url: '/api/designservice/optApproval/export',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 指定人 导出
  designatedExport(data) {
    return fetch({
      url: '/api/designservice/optApproval/specialExport',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  getExportStatus(key) {
    return fetch({
      url: `/api/designservice/common/exportExcelResult/${key}`,
      method: 'get',
      showMask: false
    })
  },
  // 查学院
  getCollege() {
    let authId = localStorage.getItem('activeAuthId')
    return fetch({
      url: `/api/designservice/common/college?authId=${authId}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 根据毕业年份和学院查专业
  getSubject(data) {
    return fetch({
      url: '/api/designservice/common/findSubject',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查课题来源
  getSource(data) {
    return fetch({
      url: '/api/designservice/settingSubjectSource/queryOptionsByYear',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 查课题性质
  getNature(data) {
    return fetch({
      url: '/api/designservice/settingSubjectProperties/queryOptionsByYear',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 查社会实践
  getPractice(data) {
    return fetch({
      url: '/api/designservice/settingSubjectSociaPractice/queryOptionsByYear',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 查审核进度
  getProgress(applyNo) {
    return fetch({
      url: `/api/workflow/approval/selectApproFlow?no=${applyNo}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 审核学生选题 查列表
  getStuTopicList() {
    return fetch({
      url: '/api/designservice/optStudentCheck/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 审核学生选题 导出
  stuTopicExport(data) {
    return fetch({
      url: '/api/designservice/optStudentCheck/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核学生选题 通过(驳回)
  stuApproval(data) {
    return fetch({
      url: '/api/designservice/optStudentCheck/audit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核学生选题 批量通过(驳回)
  stuBatchApproval(data) {
    return fetch({
      url: '/api/designservice/optStudentCheck/batchAudit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查学生信息
  getStuInfo(stuCode) {
    return fetch({
      url: `/api/designservice/common/stuDetailInfo?stuCode=${stuCode}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 查老师信息
  getTeacherInfo(teaCode) {
    return fetch({
      url: `/api/designservice/common/teaDetailInfo?teaCode=${teaCode}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 审核师生互选 查列表
  getTeacherStuList() {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 审核师生互选 导出
  teacherStuExport(data) {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核师生互选 通过(驳回)
  teacherStuApproval(data) {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/audit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核师生互选 批量通过(驳回)
  teacherStuBatchApproval(data) {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/batchAudit',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 审核师生互选 删除
  teacherStuDelete(data) {
    return fetch({
      url: '/api/designservice/optChooseEachCheck/delete',
      method: 'delete',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查看选题结果 查列表
  getResultList() {
    return fetch({
      url: '/api/designservice/optResultInfo/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    });
  },
  // 查看选题结果 导出
  resultExport(data) {
    return fetch({
      url: '/api/designservice/optResultInfo/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 分配课题 查课题列表
  getSubjectList(data) {
    return fetch({
      url: '/api/designservice/optAllotStu/queryByPageOptInfo',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 分配课题 提交
  assignSubmit(data) {
    return fetch({
      url: '/api/designservice/optAllotStu/comfirm',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 分配课题 编辑
  assignEdit(data) {
    return fetch({
      url: '/api/designservice/optAllotStu/update',
      method: 'put',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 分配课题 导出
  assignExport(data) {
    return fetch({
      url: '/api/designservice/optAllotStu/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },

  // 特殊学生分配课题 查询列表
  getSpecialList(data) {
    return fetch({
      url: '/api/designservice/optAllotSpecialStu/queryByPage',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 特殊学生分配课题 查特殊学生信息
  getStudentInfo(studentId) {
    return fetch({
      url: `/api/designservice/optAllotSpecialStu/getSpecialStuInfo?stuNo=${studentId}`,
      method: 'GET',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  insertSpecial(data) {
    return fetch({
      url: '/api/designservice/optAllotSpecialStu/addSpecialStuInfo',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 特殊学生分配课题 删除
  specialAssignDelete(data) {
    return fetch({
      url: '/api/designservice/optAllotSpecialStu/delete',
      method: 'delete',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 特殊学生分配课题 导出
  specialAssignExport(data) {
    return fetch({
      url: '/api/designservice/optAllotSpecialStu/exportList',
      method: 'post',
      headers: {
        'Content-Type': 'application/json'
      },
      data
    })
  },
  // 查校历id
  getCalendarId() {
    return fetch({
      url: '/api/baseresservice/schoolCalendar/currentTermCalendar',
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  },
  // 查校历信息
  getSchoolCalendar(id) {
    return fetch({
      url: `/api/baseresservice/schoolCalendar/${id}`,
      method: 'get',
      headers: {
        'Content-Type': 'application/json'
      }
    })
  }

}

export default api
